HookEvents()
{
	HookEvent("player_team",	Event_PlayerTeam);
	HookEvent("round_start",	Event_RoundStart);
	HookEvent("round_end",		Event_RoundEnd);
	HookEvent("player_spawn", 	Event_OnPlayerSpawn, EventHookMode_Pre);
}

public Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(IsValidPlayer(client))
	{
		new bool:disconnect = GetEventBool(event, "disconnect");
		if(!disconnect && !IsClientLoaded(client))
		{
			LoadPlayer(client);
		}
	}
}

public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	LoadAllPlayers();
}

public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
	SaveAllPlayers();
}

public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(IsValidPlayer(client))
	{
		SetColor(client, 255, 255, 255, 255);
		SetMaxSpeed(client, 1.0);
		SetSpeed(client, 1.0);
		SetFreeze(client, 0.0);
		SetSlow(client, 0.0);
		SetMaxHP(client, 100);
	}
}